<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="shortcut icon" href="img/heard.ico">
  <title>闪电配音 - 专业极速配音服务</title>
  <link rel="stylesheet" href="css/share.css?v=optimize20180613" />
</head>
<body>
  <div class="share-wrapper">
    <h1>
      <a href="http://www.soundems.com" target="_blank"><img src="img/share-title.jpg" alt=""></a>
    </h1>
    <div class="main">
      <div class="title">分享音频到微信</div>
      <div class="tip">用微信"扫一扫"二维码，即可把音频分享给您的微信好友或朋友圈供他们收听</div>
      <div class="img-container">
        <div class="left-img">
          <img src="img/share-pic.jpg" alt="">
        </div>
        <div class="line"></div>
        <div class="right-img">
          <img src="img/share-pic.jpg" alt="" id="qr">
        </div>
      </div>
    </div>
    <div class="explain">
      <div class="head">
        <div class="title">如何分享到朋友圈?</div>
        <a href="#" class="btn" id="toggleBtn">
          <span>展开提示</span>
          <img src="img/icon-down.jpg" alt="">
        </a>
      </div>
      <div class="body hide" id="share-exp">
        <img src="img/share-main.jpg" alt="">
      </div>
    </div>
  </div>
  <script src='js/jquery.min.js?v=optimize20180613' /></script>
  <script>
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return '';
    }
    var $toggleContent = $('#share-exp');
    var $toggleBtn = $('#toggleBtn');
    $toggleBtn.click(function () {
      if ($toggleContent.hasClass('hide')) {
        $toggleContent.removeClass('hide');
        $toggleBtn.find('span').text('收起提示');
      } else {
        $toggleContent.addClass('hide');
        $toggleBtn.find('span').text('展开提示');
      }
    });
    var qrUrl = GetQueryString('orderid');
    console.log(qrUrl);
    var token = localStorage.getItem('token');
    $.post('http://media.soundems.com/Post/shareqr',{token: token, oid: qrUrl},function (data) {
        if(data.code = '000000'){
            var qrUrl = data.data.fileName;
            $('.right-img img').attr('src',qrUrl)
        }
    });
    document.getElementById('qr').src = decodeURIComponent(decodeURIComponent(qr));
  </script>
</body>
</html>